package com.briup.homework.chap10.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class Bank {
    private HashMap<String,Account> accounts;
    public Bank() {
        this.accounts = new HashMap<>();
    }
    public void transfer(Account from, Account to, double amount){
        this.accounts.put(from.getName(),from);
        this.accounts.put(to.getName(),to);
        this.accounts.get(from.getName())
                .transfer(this.accounts.get(to.getName()), amount);
    }
}
